#pragma once

#include "MemoryDefined.h"

struct listFxElement
{
	void* object;
	listFxElement* next;
	listFxElement* prev;
};

class DLL_PUBLIC_GMINSTANCE CGlobalList
{
public:
	CGlobalList(void);
	~CGlobalList(void);

public:
	void Add(void* object);

	void Clear();

	BOOL Contains(void* object);

	void* Get(int index);
	void* GetNext();
	void* GetPrev();
	int IndexOf(void* object);

	BOOL IsEmpty();

	void Remove(int index);
	BOOL Remove(void* object);

	void Set(int index, void* object);
	int Size();

	void Insert(int index, void* object); // index after add
	void Delete(int index); // index after add

public:
	listFxElement* header;
	listFxElement* tailer;
	int count;

	listFxElement* GetPrivNext();

	listFxElement* currentPriv;
	listFxElement* current;
};
